package xyz.wpxy.iotlink.network.core;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import xyz.wpxy.iotlink.network.core.entity.DeviceDataEntity;

//模拟数据体
public class App {
    public static void main(String[] args) {
        String str = "{\n" +
                "    \"serviceId\": 1,\n" +
                "    \"productSn\": \"20231103143222429\",\n" +
                "    \"deviceSn\": \"20231103143404531\",\n" +
                "    \"timestamp\": 1637500709000,\n" +
                "    \"payloads\": [\n" +
                "        {\n" +
                "            \"time\": 1651753880000,\n" +
                "            \"dy_01\": 20,\n" +
                "            \"dy_02\": 17\n" +
                "        }\n" +
                "    ]\n" +
                "}";
        DeviceDataEntity deviceDataEntity = JSON.parseObject(str, DeviceDataEntity.class);
        System.out.println(deviceDataEntity);
    }
}
